// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Elastic.Clients.Elasticsearch.DanglingIndices;

public partial class DanglingIndicesNamespacedClient : NamespacedClientProxy
{
	/// <summary>
	/// <para>
	/// Initializes a new instance of the <see cref="DanglingIndicesNamespacedClient"/> class for mocking.
	/// </para>
	/// </summary>
	protected DanglingIndicesNamespacedClient() : base()
	{
	}

	internal DanglingIndicesNamespacedClient(ElasticsearchClient client) : base(client)
	{
	}

	/// <summary>
	/// <para>
	/// Returns all dangling indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual ListDanglingIndicesResponse ListDanglingIndices(ListDanglingIndicesRequest request)
	{
		request.BeforeRequest();
		return DoRequest<ListDanglingIndicesRequest, ListDanglingIndicesResponse, ListDanglingIndicesRequestParameters>(request);
	}

	/// <summary>
	/// <para>
	/// Returns all dangling indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListDanglingIndicesResponse> ListDanglingIndicesAsync(ListDanglingIndicesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ListDanglingIndicesRequest, ListDanglingIndicesResponse, ListDanglingIndicesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns all dangling indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual ListDanglingIndicesResponse ListDanglingIndices(ListDanglingIndicesRequestDescriptor descriptor)
	{
		descriptor.BeforeRequest();
		return DoRequest<ListDanglingIndicesRequestDescriptor, ListDanglingIndicesResponse, ListDanglingIndicesRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>
	/// Returns all dangling indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual ListDanglingIndicesResponse ListDanglingIndices()
	{
		var descriptor = new ListDanglingIndicesRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequest<ListDanglingIndicesRequestDescriptor, ListDanglingIndicesResponse, ListDanglingIndicesRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>
	/// Returns all dangling indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
	public virtual ListDanglingIndicesResponse ListDanglingIndices(Action<ListDanglingIndicesRequestDescriptor> configureRequest)
	{
		var descriptor = new ListDanglingIndicesRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequest<ListDanglingIndicesRequestDescriptor, ListDanglingIndicesResponse, ListDanglingIndicesRequestParameters>(descriptor);
	}

	/// <summary>
	/// <para>
	/// Returns all dangling indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListDanglingIndicesResponse> ListDanglingIndicesAsync(ListDanglingIndicesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ListDanglingIndicesRequestDescriptor, ListDanglingIndicesResponse, ListDanglingIndicesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns all dangling indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListDanglingIndicesResponse> ListDanglingIndicesAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new ListDanglingIndicesRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<ListDanglingIndicesRequestDescriptor, ListDanglingIndicesResponse, ListDanglingIndicesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns all dangling indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListDanglingIndicesResponse> ListDanglingIndicesAsync(Action<ListDanglingIndicesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ListDanglingIndicesRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ListDanglingIndicesRequestDescriptor, ListDanglingIndicesResponse, ListDanglingIndicesRequestParameters>(descriptor, cancellationToken);
	}
}